import request from '@/utils/request'

/**
 * 获取个人卡片信息列表
 * @returns 
 */
export const getMyInfoListService = () => {
    return request.get("/admin/myInfo")
}

/**
 * 获取每日一言信息
 * @returns 
 */
export const getEveryDayService = () => {
    return request.get('/admin/myInfo/wordList')
}

/**
 * 根据id查询个人卡片详细信息
 * @param {*} id 
 * @returns 
 */
export const getMyInfoByIdService = (id) => {
    return request.get(`/admin/myInfo/${id}`)
}

/**
 * 新增个人信息
 * @param {*} query 
 * @returns 
 */
export const addMyInfoService = (query) => {
    return request.post('/admin/myInfo/add', query)
}

/**
 * 修改个人信息
 * @param {*} query 
 * @returns 
 */
export const updateMyInfoService = (query) => {
    return request.put("/admin/myInfo/update",query)
}

/**
 * 修改个人信息状态
 * @param {*} query 
 * @returns 
 */
export const updateMyInfoStatusService = (query) => {
    return request.put('/admin/myInfo/status', query)
}

/**
 * 删除个人信息
 * @param {*} id 
 * @returns 
 */
export const deleteByMyInfoIdService = (id) => {
    return request.delete(`/admin/myInfo/${id}`)
}

/**
 * 查询个人社交信息
 * @returns 
 */
export const getMySocialListService = () => {
    return request.get('/admin/myInfo/social')
}

/**
 * 发布每日一言
 * @param {*} word 
 * @returns 
 */
export const addEveryDayWordService = (word) => {
    return request.post('/admin/myInfo/add/word', {
        word: word
    })
}

/**
 * 修改每日一言状态
 * @param {*} id 
 * @param {*} status 
 * @returns 
 */
export const updtaeEveryWordStatusService = (id,status) => {
    return request.put('/admin/myInfo/update/word/status', {
        id: id,
        status: status
    })
}

/**
 * 批量删除每日一言
 * @param {*} ids 
 * @returns 
 */
export const deleteEveryWordBatchService = (ids) => {
    return request.delete('/admin/myInfo/delete/word', {
        data: ids
    })
}

/**
 * 根据id查询每日一言
 * @param {*} id 
 * @returns 
 */
export const getEveryWordByIdService = (id) => {
    return request.get(`/admin/myInfo/word/${id}`)
}

/**
 * 修改每日一言
 * @param {*} query 
 * @returns 
 */
export const updateEveryWordService = (query) => {
    return request.put('/admin/myInfo/update/word',query)
}

